﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>客户列表</title>
<#--freemarker引入模板文件，相对路径-->
    <#include "../common/link.ftl">
    <script>
        //需要将状态值发送到后台？？？
        //构造JSON格式的数据？

    </script>

</head>
<body class="hold-transition skin-blue sidebar-mini">

<div class="wrapper">
    <#include "../common/navbar.ftl">
    <!--菜单回显-->
    <#assign currentMenu="customer"/>

    <#include "../common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>客户列表</h1>
        </section>
        <section class="content">

            <div class="box">
                <!--高级查询--->
                <form class="form-inline" id="searchForm" action="/customer/list.do" method="post">
                    <div class="form-group">
                        <label for="keyword">关键字:</label>
                        <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}"
                               placeholder="请输入姓名/电话">
                    </div>

                    <div class="form-group">
                    <#-- <@shiro.hasAnyRoles name="admain,Market_Manager">-->
                        <label for="dept"> 状态:</label>
                        <select class="form-control" id="sellerId" name="sellerId">
                            <option value="">全部</option>
                                    <option value="0">潜在客户</option>
                                    <option value="4">客户池</option>
                                    <option value="2">失败客户</option>
                                    <option value="1">正式客户</option>
                                    <option value="3">流失客户</option>
                        </select>
                        <script>
                            $('#sellerId').val(${qo.sellerId!})
                        </script>
                    <#-- </@shiro.hasAnyRoles>-->
                    </div>
                    <div class="form-group">
                    <#-- <@shiro.hasAnyRoles name="admain,Market_Manager">-->
                        <label for="dept"> 市场专员:</label>
                        <select class="form-control" id="sellerId" name="sellerId">
                            <option value="-1">全部</option>
                                <#list employees! as e>
                                    <option value="${e.id!}">${e.name!}</option>
                                </#list>
                        </select>
                        <script>
                            $('#sellerId').val(${qo.sellerId!})
                        </script>
                    <#-- </@shiro.hasAnyRoles>-->
                    </div>
                    <button id="btn_query" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span>
                        查询
                    </button>
                </form>
                <!--页面显示内容-->
                <div class="box-body table-responsive no-padding ">
                    <table class="table table-hover table-bordered">
                        <tr>
                            <th>编号</th>
                            <th>姓名</th>
                            <th>电话</th>
                            <th>QQ</th>
                            <th>职业</th>
                            <th>来源</th>
                            <th>销售员</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        <#list result.list! as customer>
                            <tr>
                                <td>${customer_index + 1}</td>
                                <td>${customer.name!}</td>
                                <td>${customer.tel!}</td>
                                <td>${customer.qq!}</td>
                                <td>${(customer.job.title)!}</td>
                                <td>${(customer.source.title)!}</td>
                                <td>${(customer.seller.name)!}</td>
                                <td>${customer.statusName!}</td>
                            </tr>
                        </#list>
                    </table>

                    <!--分页插件的引用-->
                    <#include "../common/page.ftl"/>

                </div>
            </div>
        </section>
    </div>
    <#include "../common/footer.ftl"/>
</div>

</body>
</html>
